$(document).ready(function(){
	
	
	$("#dataPedido, #inputDataPagamento").datepicker({
		format: "dd/mm/yyyy",
		language: "pt-BR",
		autoclose: true
	});
	
	
	$( ".uppercase" ).keyup(function() {

		var upper = $(this).val().toUpperCase();

		$(this).val(upper);
	});
	
	
	$('#cliente').autocomplete({
		serviceUrl: $("#contextPage").val()+'/getTags',
		paramName: "tagName",
		delimiter: ",",
		minChars: 3,
		onSelect: function (suggestion) {
			$("#idClienteHidden").val(suggestion.data);
	    },
		
	    transformResult: function(response) {
	    	
	        return {
	        	
	            suggestions: $.map($.parseJSON(response), function(item) {
	            	
	                return { value: item.tagName, data: item.id };
	            })
	            
	        };
	        
	    }
	    
	});
	
});	